Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports System.Reflection

Namespace RTP.HTMLNewsletter

    Public MustInherit Class DataProvider

#Region "Shared/Static Methods"
        ' singleton reference to the instantiated object 
        Private Shared objProvider As DataProvider = Nothing

        ' constructor
        Shared Sub New()
            CreateProvider()
        End Sub

        ' dynamically create provider
        Private Shared Sub CreateProvider()
            objProvider = CType(Framework.Reflection.CreateObject("data", "RTP.HTMLNewsletter", ""), DataProvider)
        End Sub

        ' return the provider
        Public Shared Shadows Function Instance() As DataProvider
            Return objProvider
        End Function

#End Region

        Public MustOverride ReadOnly Property ObjectQualifier() As String
        Public MustOverride ReadOnly Property DatabaseOwner() As String


#Region "Newsletter Functions"
        Public MustOverride Function AddNewsletter(ByVal NLSummary As String, ByVal NLBody As String, ByVal NLDesc As String, ByVal NLAttachment As String, ByVal NLRoleSent As Integer, _
                                                   ByVal NLUserID As Integer, ByVal NLEmail As String, ByVal ModuleID As Integer, ByVal ArticleID As Integer, ByVal ArticleTabModuleID As Integer, _
                                                   ByVal Published As Boolean, ByVal PublishDate As DateTime, ByVal PortalID As Integer) As Integer
        Public MustOverride Sub UpdateNewsletter(ByVal NLID As Integer, ByVal NLSummary As String, ByVal NLBody As String, ByVal NLDesc As String, ByVal NLAttachment As String, ByVal NLRoleSent As Integer, ByVal NLUserID As Integer, ByVal NLEmail As String, ByVal ModuleID As Integer, ByVal ArticleID As Integer, ByVal ArticleTabModuleID As Integer, ByVal Published As Boolean, ByVal PublishDate As DateTime)
        Public MustOverride Sub DeleteNewsletter(ByVal NLID As Integer)
        Public MustOverride Function GetNewslettersByUserID(ByVal UserID As Integer, ByVal PortalID As Integer, ByVal AdminUser As Boolean) As IDataReader
        Public MustOverride Function GetNewsletterById(ByVal NLID As Integer) As IDataReader
        Public MustOverride Function GetNewslettersForEdit(ByVal ModuleID As Integer) As IDataReader
#End Region

#Region "Newsletter User Functions"
        Public MustOverride Function AddNewsletterUser(ByVal NLID As Integer, ByVal UserID As Integer, ByVal Ignore As Boolean, ByVal Sent As Boolean, ByVal UserEmail As String, ByVal NewsletterCategoryID As Integer, ByVal PublishDate As DateTime, ByVal PortalAliasID As Integer) As Integer
        Public MustOverride Sub UpdateNewsletterUser(ByVal NLID As Integer, ByVal UserID As Integer, ByVal Ignore As Boolean, ByVal Sent As Boolean, ByVal PublishDate As DateTime)
        Public MustOverride Function GetNewsletterUserUnsent() As IDataReader
#End Region

#Region "Newsletter Template Functions"
        Public MustOverride Function AddNewsletterTemplate(ByVal TLBody As String, ByVal TLName As String, ByVal PortalID As Integer) As Integer
        Public MustOverride Function GetNewsletterTemplates(ByVal PortalID As Integer) As IDataReader
        Public MustOverride Function GetNewsletterTemplateById(ByVal TLID As Integer) As IDataReader
        Public MustOverride Sub UpdateNewsletterTemplate(ByVal TLBody As String, ByVal TLID As Integer, ByVal PortalID As Integer)
        Public MustOverride Sub DeleteNewsletterTemplate(ByVal TLID As Integer)
#End Region

#Region "Newsletter Categorys Functions"
        Public MustOverride Function AddNewsletterCategory(ByVal NewsletterID As Integer, ByVal CategoryID As Integer) As Integer
        Public MustOverride Function GetNewsletterCategorysByNewsletterID(ByVal NewsletterID As Integer) As IDataReader
        Public MustOverride Function GetNewsletterCategoryByNewsletterIDCategoryID(ByVal NewsletterID As Integer, ByVal CategorID As Integer) As IDataReader
        Public MustOverride Sub DeleteNewsletterCategory(ByVal NewsletterID As Integer, ByVal CategoryID As Integer)
#End Region

#Region "Ventrian News Articles Functions"
        Public MustOverride Sub UpdateVentrianNAImages(ByVal ArticleID As Integer)
#End Region
    End Class

End Namespace
